/**
 * @class tuan.store.OrderStore
 * @extends extendsClass
 * Description
 */


Ext.define('tuan.store.CustomerStore', {
    extend: 'Ext.data.Store',
    model : "tuan.model.CustomerModel",
    remoteFilter: true,
    pageSize: 10,
    autoDestroy: true,
    autoLoad : true,
    remoteSort: true,
    autoSync : true,
    proxy : {
    	type : "rest",
        headers : {
            "X-ASCCPE-USERNAME" :'quanly_main',
            "X-ASCCPE-PASSWORD" : 'giongnhucu'
        },
    	api : {
    		read : tuan.config.Runtime.linkUrl+"/api/accounts",
    		create : tuan.config.Runtime.linkUrl+"api/accounts",
    		update : tuan.config.Runtime.linkUrl+"api/accounts",
    		destroy : tuan.config.Runtime.linkUrl+"api/accounts",
    	},
    	reader : {
    		type : "json",
    		root : "lists",
            totalProperty: 'totalCount',  
    	},
                    // sends single sort as multi parameter
        simpleSortMode: true,
        extraParams : ''
    },
       onCreateRecords: function(records, operation, success) {
        console.log(records);
    },
    sorters: [{
        property: 'id',
        direction: 'DESC'
    }]
});